<template>
  <div>
    <!-- 以下为标签页组件 -->
    <tabs @searchParent="searchParent"></tabs>
    <!-- 以下是信息组件 -->
    <informations
      :dataList="informationsData"
      @deleteBtn="deleteBtnFather"
    ></informations>
    <!-- 以下是分页组件  -->
    <skip></skip>
    <!-- 以下是编辑表单组件 -->
    <editform></editform>
  </div>
</template>
<script>
import tabs from "../OrderForm/components/Tabs.vue";
import informations from "../OrderForm/components/Informations.vue";
import skip from "../OrderForm/components/skip.vue";
import editform from "../OrderForm/components/Editform.vue";
import { getHome } from "../../api/orderform";

export default {
  components: {
    tabs,
    informations,
    skip,
    editform,
  },
  mounted() {
    // this.getData();
    getHome({ search: { input: "", value2: "" } }).then((res) => {
      if (res.code == 200) {
        console.log("数据已刷新");
        this.informationsData = res.data;
      }
    });
  },
  data() {
    return {
      informationsData: [],
      search: "",
    };
  },

  methods: {
    searchParent(val) {
      this.search = val;
      console.log(this.search);
      this.getData();
    },
    getData() {
      getHome({ search: this.search }).then((res) => {
        if (res.code == 200) {
          console.log("数据已刷新");
          this.informationsData = res.data;
        }
      });
    },
    deleteBtnFather() {
      console.log("1");
    },
  },
};
</script>
<style></style>
